<template>
	<view class="">
		<view class="noticeBox">
			<view class="top"></view>
			<u-swipe-action>
				<u-swipe-action-item :options="optionsData" v-for="(item, index) in dataList" :key="index" @click="btnDetele(item,index)">
					<view class="swipe-action" v-if="item">
						<view class="noticeBox-v1">
							<text class="">提醒通知</text>
							<text class="">今天 16:49</text>
						</view>
						<view class="noticeBox-v2">驱虫时间到了</view>
					</view>
				</u-swipe-action-item>
			</u-swipe-action>
		</view>

		<!-- 加载更多 -->
		<view class="">
			<u-loadmore :status="status" v-if="dataList && dataList.length > 0" />
			<u-empty v-if="dataList && dataList.length == 0" mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png"></u-empty>
		</view>
	</view>
</template>

<script>
import { mapState } from 'vuex';
import pageMixin from '@/mixins/pageMixin';

export default {
	mixins: [pageMixin],
	components: {},
	data() {
		return {
			optionsData: [
				{
					text: '删除',
					style: {
						backgroundColor: 'rgb(245, 108, 108)'
					}
				}
			],
			dataList: [
				{ id: 1, name: 11 },
				{ id: 2, name: 22 },
	
			],
			status: 'nomore' //加载 loadmore/ loading / nomore
		};
	},
	computed: {},
	onLoad(options) {},
	methods: {
		btnDetele(item,index) {
			console.log('点击删除',item);
		    this.$set(this.dataList,index,null)			
			return
			// 信息
			noticeDelete({id:item.id}).then(res=>{
				
			})
		
		}
	}
};
</script>
<style>
page {
	background-color: #fff;
	padding-bottom: 10rpx;
}
</style>
<style lang="scss" scoped>
.noticeBox {
	.top {
		width: 100%;
		height: 15rpx;
		background-color: #f5f5f5;
	}
	.swipe-action {
		background-color: #fff;
		padding: 32rpx;
		border-bottom: 2rpx solid #ededed;
		.noticeBox-v1 {
			margin-bottom: 20rpx;
			width: 100%;
			display: flex;
			justify-content: space-between;
			align-items: center;

			text:nth-child(1) {
				font-size: 32rpx;
				font-family: PingFangSC-Medium, PingFang SC;
				font-weight: 500;
				color: #1a1a1a;
				line-height: 32rpx;
			}
			text:nth-child(2) {
				font-size: 24rpx;
				font-family: PingFangSC-Regular, PingFang SC;
				font-weight: 400;
				color: #cccccc;
				line-height: 24rpx;
			}
		}
		.noticeBox-v2 {
			font-size: 28rpx;
			font-family: PingFangSC-Regular, PingFang SC;
			font-weight: 400;
			color: #999999;
			line-height: 28rpx;
		}
	}
}
</style>
